/**
 * 
 */
package com.fita.api.web.controller;

import java.util.HashMap;
import java.util.Map;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.http.MediaType;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.RestController;

import com.fita.api.handler.QiniuHandler;

/**
 * @author Guangli Yan
 *
 */
@RestController
@RequestMapping(path = "/api/qiniu")
public class QiniuController {

	@Autowired
	private QiniuHandler qiniuHandler;
	
	@RequestMapping(path = "/token", produces = MediaType.APPLICATION_JSON_VALUE, method = RequestMethod.GET)
	public Object getQiniuToken(){
		
		Map<String, Object> result = new HashMap<String, Object>();
		
		String token = qiniuHandler.getToken();
		
		result.put("uptoken", token);
		
		return result;
	}
	
}
